package com.habbot.beautifyinghandbook.ui;

import com.habbot.beautifyinghandbook.R;

import android.app.Dialog;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class InfoDialog extends Dialog implements
		android.view.View.OnClickListener {
	private Button mBtnSend;
	private TextView mTvVersion;

	public InfoDialog(Context context) {
		super(context, R.style.AppDialogTheme);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_info);
		initComponents();
		addListener();
	}

	public void initComponents() {
		mBtnSend = (Button) findViewById(R.id.btn_send);

		mTvVersion = (TextView) findViewById(R.id.tv_version);
		try {
			mTvVersion.setText("Version "
					+ getContext().getPackageManager().getPackageInfo(
							getContext().getPackageName(), 0).versionName);
		} catch (NameNotFoundException e) {
			e.printStackTrace();
		}
	}

	public void addListener() {
		mBtnSend.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_send:

			break;

		default:
			break;
		}
	}

}
